home *** CD-ROM | disk | FTP | other *** search
- ;*******************************************************
- ; B E G I N C O N F I G U R A T I O N
- ;
- ; TRACE1E.AIC built by Arny Krueger 02/22/86
- ;
- ;*******************************************************
-
- ;
- ; Some general equates for civilized coding
- ;
-
-
- cr equ 13
- lf equ 10
-
- ;********************************************************
- ;
- ; Equates used for general configuration
- ;
- ;********************************************************
-
- ;
- ; Set trace_size to number of K bytes to set aside for trace table.
- ;
-
- trace_size equ 30
-
- ;
- ; Set iamhere to be a flag that indicates we are already in place.
- ; The first byte is interpreted as a DOS function number (AH) for INT 21h
- ;
-
- iamhere equ 0E0E0h
-
- ;
- ; Set peri_int to the interrupt number (usually 060H) to be used
- ; by Periscope to invoke our reporting routines.
- ;
-
- peri_int equ 060h
-
- ;
- ; Set prt_scr non-zero to assemble code that allows control via SHIFT-PrtSc.
- ;
-
- prt_scr equ 1
-
- ;
- ; Set use_prt non-zero to start up using the printer instead of the screen
- ;
-
- use_prt equ 0
-
- ;
- ; Set num_feeds to number of extra Linefeeds to send to printer to jack
- ; up the paper enough to let you read it, after display of menus etc.
- ; Note! in TRACE2E.AIC
-
- Num_feeds equ 5 ;Number of line feeds on printer after prompt
-
- ;********************************************************
- ;
- ; Equates used for printing and formatting
- ;
- ;********************************************************
-
- Edit_End equ 0f0h ;End of input line
- Edit_Byte equ 0f1h ;Next byte is 8-bit value to be printed in hex
- Edit_Word equ 0f2h ;Next 2 bytes are 16-bit value to be printed in hex
- Edit_Line equ 0f3h ;Next 2 bytes are address of string for print_line()
- Edit_Call equ 0f4h ;Next byte is AH arg, next 2 are DX arg,
- ;and next 2 are subroutine address to call
- Edit_Dec8 equ 0f5h ;Next byte is 8-bit value to be printed as decimal
- Edit_Dec16 equ 0f6h ;Next 2 bytes are 16-bit value to be printed as decimal
- Edit_Skip equ 0f7h ;Ignore this byte (don't display it)
-
-
- ;********************************************************
- ;
- ; Map of Before and After entries in the trace table
- ;
- ;********************************************************
-
- ;
- ; Trace entry byte zero (the type byte) identifies entry as follows:
- ;
- ; Bits 7-4 = trace type
- ;
- ; 0000 = BEFORE int was executed
- ; 0001 = AFTER int was executed
- ; 0010 = FCB referenced by an INT 21h
- ; 0011 = ASCIIZ referenced by an INT 21h
- ;
- ; Bit 3 = RESERVED
- ;
- ; Bits 2-0 = ICT # (0-7) which made this trace record
- ;
- ; Record formats are as follows:
- ;
-
- BEFORE struc ;BEFORE trace entry
- B_type db ? ;see above
- B_int db ? ;INT # that was trapped
- B_ax dw ? ;Regs BEFORE executing INT
- B_bx dw ?
- B_cx dw ?
- B_dx dw ?
- B_es dw ?
- B_ds dw ?
- B_ss dw ?
- B_sp dw ?
- B_si dw ?
- B_di dw ?
- B_bp dw ?
- B_cs dw ? ;CS of invoker of INT
- B_ip dw ? ;IP of invoker
- BEFORE ends
-
- AFTER struc ;AFTER record type
- A_type db ? ;see above
- A_int db ? ;INT # that was executed
- A_ax dw ? ;Regs AFTER executing INT
- A_bx dw ?
- A_cx dw ?
- A_dx dw ?
- A_es dw ?
- A_ds dw ?
- A_si dw ?
- A_di dw ?
- A_bp dw ?
- A_flags dw ? ;Flags AFTER doing INT
- AFTER ends
-
- FCB struc ;INT 21h FCB record
- FCB_type db ? ;see above
- FCB_int db ? ;INT # that was executed (21h)
- FCB_drive db ? ;drive field of FCB
- FCB_name db "????????" ;filename field of FCB
- FCB_ext db "???" ;extension field of FCB
- FCB ends
-
- ASCIIZ struc ;INT 21h ASCIIZ record
- AZ_type db ? ;see above
- AZ_int db ? ;INT # that was executed (21h)
- AZ_str db "?????????????????????????????????????????????????????????????????"
- ASCIIZ ends
-
-
- ;********************************************************
- ;
- ; Definition of Interrupt Control Table count
- ;
- ;********************************************************
-
- number_icts equ 16 ;note: number of ICT's
- ;built into executable code
- ;in trace1.asm
-
- ;********************************************************
- ;
- ; Definition of Interrupt Control Table entries
- ;
- ;********************************************************
-
- ICT struc
- ICT_flags db ? ;See below
- ICT_flags2 db ? ;See belop
- ICT_intnum db ? ;interrupt # this table belongs to
- ICT_AH_lo db ? ;lower AH limit to trace
- ICT_AH_hi db ? ;upper AH limit to trace
- ICT_orig_hndlr dd ? ;cs:ip of original handler
- ICT_hits dw ? ;# traces made for this ICT
- ICT_num db ? ;ICT number (0-7)
- ICT ends
-
- ;
- ; Equates for flags byte of ICT
- ;
-
- F_ACTIVE equ 10000000b ;Bit 7 = this ICT is active
- F_RET equ 01000000b ;Bit 6 = This INT exits via RET
- F_RET2 equ 00100000b ;Bit 5 = This INT exits via RET2
- F_IRET equ 00010000b ;Bit 4 = This INT exits via IRET
- F_ENABLE equ 00001000b ;Bit 3 = Tracing enabled for this ICT
- F_FCB equ 00000100b ;Bit 2 = enable FCB/ASCII traces for INT 21h
- F_ROM equ 00000010b ;Bit 1 = exclude ROM invocations of this INT
- F_BELOW equ 00000001b ;Bit 0 = exclude invokers below us (DOS etc)
-
- ;
- ; Equates for flags2 byte of ICT
- ;
-
- F_CALL equ 10000000b ;Bit 7 = This ICT never returns
-
-
- ;
- ; Define interrupts to be traced by filling in the following ICT's.
- ; Note that there are only 8. That's the max that can be traced.
- ; Note that the F_ACTIVE flag must be set in used ICT's, and off in
- ; those that aren't defining something that you want traced.
- ;
- ; Don't mess with the last 3 fields in the ICT!!! Leave 'em as-is.
- ;
- ; It is EXTREMELY important that you specify how the interrupt exits.
- ; Set exactly one of the following flag bits:
- ;
- ; F_RET Interrupt exits via simple far RET, leaving original interrupts
- ; on the stack for the caller to pop. INT's 025H and 026H are prime
- ; examples.
- ;
- ; F_RET2 Interrupt exits via RET 2, dropping original flags and returning
- ; flags as set by interrupt handler. INT 021H (and anybody else
- ; that uses flags like CARRY or ZERO to reflect results) does this.
- ;
- ; F_IRET Interrupt exits via IRET, restoring original flags from stack.
- ; Hardware interrupt handlers do this, and many ROM BIOS routines.
- ;
- ; Note that some interrupts may exit differently, depending on the specific
- ; function requested. You may want to define several ICT's for a given
- ; interrupt, each handling a different AH range.
- ;
- ;
-
-
-
-
-
-
-
-
-
-
-